var $;
var form;
var layedit;
var laydate;

layui.use('jquery', function() {
    $ = layui.jquery;
    $.ajax({
        url: "/Teacher/selVideo",
        type: "get",
        dataType: "json",
        data: {},
        success: function (data) {
            $("input[name=id]").val(data.obj.id);
            $("input[name=looknum]").val(data.obj.lookNum)
            $("input[name=collectnum]").val(data.obj.collectNum);
            $("input[name=likenum]").val(data.obj.likeNum);
            selChuLi();
        }
    });
    function selChuLi(){
        $.ajax({
            url: "/Teacher/selChuLi",
            type: "get",
            dataType: "json",
            data: {},
            success: function (data) {
                $("input[name=cstatus]").val(data.obj.cstatus);
                $("input[name=cstatus1]").val(data.obj.cstatus1);
                selYiShangJia()
            }
        });
    }

    function selYiShangJia(){
        $.ajax({
            url: "/Teacher/selShelves",
            type: "get",
            dataType: "json",
            data: {},
            success: function (data) {
                $("input[name=courseStatus]").val(data.obj.course_status);
                $("input[name=productSate]").val(data.obj.product_sate);
                selToday();
            }
        });
    }

    function selToday(){
        $.ajax({
            url: "/Teacher/selToday",
            type: "get",
            dataType: "json",
            data: {},
            success: function (data) {
                $("input[name=Today]").val(data.obj);
                selYesterDay();
            }
        });
    }
    function selYesterDay(){
        $.ajax({
            url: "/Teacher/selYesterDay",
            type: "get",
            dataType: "json",
            data: {},
            success: function (data) {
                $("input[name=Yesterday]").val(data.obj);
                selMonth();
            }
        });
    }
    function selMonth(){
        $.ajax({
            url: "/Teacher/selMonth",
            type: "get",
            dataType: "json",
            data: {},
            success: function (data) {
                $("input[name=Month]").val(data.obj);
                selAll();
            }
        });
    }
    function selAll(){
        $.ajax({
            url: "/Teacher/selAll",
            type: "get",
            dataType: "json",
            data: {},
            success: function (data) {
                $("input[name=All]").val(data.obj);
                selSeven();
            }
        });
    }
    function selSeven(){
        $.ajax({
            url: "/Teacher/selWeek",
            type: "get",
            dataType: "json",
            data: {},
            success: function (data) {
                $("input[name=Seven]").val(data.obj);
            }
        });
    }
})

function OneWeek(){

    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('main'));
    // 指定图表的配置项和数据
    option = {
        color: '#8CE24F',
        xAxis: {
            type: 'category',
            data: ['07-01周六', '07-02周日', "07-03周一", '07-04周二', '07-05周三', '07-06周四', '07-07周五']
        },
        yAxis: {
            type: 'value',
            min:0, // 设置y轴刻度的最小值
            max:200,  // 设置y轴刻度的最大值
            splitNumber:4,  // 设置y轴刻度间隔个数
        },
        center: [200, 300],
        series: [{
            data: [100,200,150,50,150,100,35],
            symbolSize: 10, // 图表	的点的大小
            type: 'line'
        }]
    };
    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
}



